package esay.dynamic.programming;

/**
 *
 * @author ruizhou
 * @date 26.02.2018
 */
public class ClimbingStairs {
    private static int climbStairs(int n) {
        if (n < 2) {
            return n;
        }
        int pre = 1;
        int cur = 2;
        for(int i = 2;i < n; i++){
            int tmp = cur;
            cur = cur + pre;
            pre = tmp;
        }
        return cur;
    }

    public static void main(String[] args) {
        System.out.println(climbStairs(1000));
    }
}
